/**
 * 
 */
package com.dycn.posdashboard.data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author gongqiyi
 *
 */
public class PosTransactionData implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2352630665321826183L;

	public static Integer POS_TRADE_NORMAL=1;//01-POS消费
	public static Integer POS_TRADE_OTO=22;//22- OTO-POS消费
	public static Integer POS_TRADE_CANCEL=31;//31-POS取消,
	public static Integer POS_TRADE_FIX=41;//41-POS冲正

	
	private String serviceProviderNo;//总公司号
	private String serviceProviderName;//总公司名
	private String branchNo;//提供交易服务分公司号
	private String branchName;//提供交易服务分公司名
	private String terminalMerchantNo;//交易商户终端号=>交易商户号
	private String terminalMerchantName;//交易商户终端名=>交易商户名
	private Integer cmId=303;
	private String cardNo;
	private String tradeType;//'01-POS消费，22- OTO-POS消费,31-POS取消,41-POS冲正',
	private Double tradeMoney;
	private Double tradeFee;
	private Date tradeDate;
	private String tradeOrderId;
	private String terminalBatchNo;//终端批次号
	private String terminalOrderNo;//终端流水号
	private String oldTerminalOrderNo;//原终端流水号
	private String comments;
	
	private String inOrderNo="";//OTO网上订单号	12	可空	字符串，代表网上下单的订单号
	private String rtnOrderNo="";//第三方回复订单号	20	可空	字符串，代表第三方服务端处理完回复到商赢的订单号
	
	private Date createTime;//记录的创建时间
	
	
	public String getInOrderNo() {
		return inOrderNo;
	}
	public void setInOrderNo(String inOrderNo) {
		this.inOrderNo = inOrderNo;
	}
	public String getServiceProviderNo() {
		return serviceProviderNo;
	}
	public void setServiceProviderNo(String serviceProviderNo) {
		this.serviceProviderNo = serviceProviderNo;
	}
	public String getServiceProviderName() {
		return serviceProviderName;
	}
	public void setServiceProviderName(String serviceProviderName) {
		this.serviceProviderName = serviceProviderName;
	}
	public String getBranchNo() {
		return branchNo;
	}
	public void setBranchNo(String branchNo) {
		this.branchNo = branchNo;
	}
	public String getBranchName() {
		return branchName;
	}
	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}
	public String getTerminalMerchantNo() {
		return terminalMerchantNo;
	}
	public void setTerminalMerchantNo(String terminalMerchantNo) {
		this.terminalMerchantNo = terminalMerchantNo;
	}
	public String getTerminalMerchantName() {
		return terminalMerchantName;
	}
	public void setTerminalMerchantName(String terminalMerchantName) {
		this.terminalMerchantName = terminalMerchantName;
	}
	
	public Integer getCmId() {
		return cmId;
	}
	public void setCmId(Integer cmId) {
		this.cmId = cmId;
	}
	public String getCardNo() {
		if(cardNo==null||cardNo.trim().equals("")){
			cardNo="0";
		}
		return cardNo;
	}
	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}
	public String getTradeType() {
		return tradeType;
	}
	public void setTradeType(String tradeType) {
		this.tradeType = tradeType;
	}
	public Double getTradeMoney() {
		return tradeMoney;
	}
	public void setTradeMoney(Double tradeMoney) {
		this.tradeMoney = tradeMoney;
	}
	public Double getTradeFee() {
		return tradeFee;
	}
	public void setTradeFee(Double tradeFee) {
		this.tradeFee = tradeFee;
	}
	public String getTradeOrderId() {
		return tradeOrderId;
	}
	public void setTradeOrderId(String tradeOrderId) {
		this.tradeOrderId = tradeOrderId;
	}
	public String getTerminalBatchNo() {
		return terminalBatchNo;
	}
	public void setTerminalBatchNo(String terminalBatchNo) {
		this.terminalBatchNo = terminalBatchNo;
	}
	public String getTerminalOrderNo() {
		return terminalOrderNo;
	}
	public void setTerminalOrderNo(String terminalOrderNo) {
		this.terminalOrderNo = terminalOrderNo;
	}
	public String getOldTerminalOrderNo() {
		return oldTerminalOrderNo;
	}
	public void setOldTerminalOrderNo(String oldTerminalOrderNo) {
		this.oldTerminalOrderNo = oldTerminalOrderNo;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getTradeDate() {
		return tradeDate;
	}
	public void setTradeDate(Date tradeDate) {
		this.tradeDate = tradeDate;
	}

	public String getRtnOrderNo() {
		return rtnOrderNo;
	}
	public void setRtnOrderNo(String rtnOrderNo) {
		this.rtnOrderNo = rtnOrderNo;
	}
	@Override
    public boolean equals (Object in) {
        if(in == null) {
        	return false;
        }else if( in instanceof PosTransactionData) {
        	PosTransactionData inObj = (PosTransactionData) in;
        	if(branchNo!=null&&branchNo.equals(inObj.getBranchNo())
        			&&terminalMerchantNo!=null&&terminalMerchantNo.equals(inObj.getTerminalMerchantNo())
        			&&cardNo!=null&&cardNo.equals(inObj.getCardNo())
        			&&tradeOrderId!=null&&tradeOrderId.equals(inObj.getTradeOrderId())){
        		return true;
        	}else{
        		return false;
        	}
        }else {
        	return false;
        }       
    } 
}
